import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../AppConfig/Config.dart';
import '../../l10n/messages.dart';

class InvoiceHeader extends StatefulWidget {
  const InvoiceHeader({super.key});

  @override
  State<InvoiceHeader> createState() => _InvoiceHeaderState();
}

class _InvoiceHeaderState extends State<InvoiceHeader> {
  bool isSwitched = true;
  @override
  Widget build(BuildContext context) {
    var messages = AppLocalizations.of(context)!;
    final screenSize = MediaQuery.of(context).size;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
      appBar: AppBar(
        backgroundColor: Colors.white,
        centerTitle: true,
        title: Text(messages['发票抬头'],style: TextStyle(color: Colors.black,fontWeight: FontWeight.w300,fontSize: 16.sp),),
      ),
      body: Column(
    children: [
    Expanded(child:
    ListView(
      children: [
        Container(
          padding: EdgeInsets.only(left: 8.w,right: 8.w,top: 10.h,bottom: 10.h),
          margin: EdgeInsets.only(left: 10.w,right: 10.w),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.all(Radius.circular(10)),
          ),
          child: Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Row(
                    children: [
                      Text("*",style: TextStyle(color: Colors.red),),
                      Text("名称",style: TextStyle(color: Colors.black),),
                    ],
                  ),

                  Container(
                    height: 30.h,
                    width: 230.w,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(30))),
                    child:   TextField(
                      decoration: InputDecoration(
                        hintText: '请输入企业名称',
                        hintStyle:TextStyle(fontSize: 12.sp,color: MyColors.textColor),
                        filled: true,
                        fillColor: MyColors.backgreyColor,
                        border: InputBorder.none,
                        alignLabelWithHint: true,
                        contentPadding: EdgeInsets.symmetric(vertical: 10.0.h, horizontal: 10.0.w),
                      ),
                      textAlign: TextAlign.right,
                      style: TextStyle(color: Colors.black),
                      onChanged: (value) {
                        setState(() {
                          print(value);
                        });
                      },
                    ),
                  ),

                ],
              ),
              SizedBox(height: 8.h,),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Row(
                    children: [
                      Text("*",style: TextStyle(color: Colors.red),),
                      Text("纳税人识别号",style: TextStyle(color: Colors.black),),
                    ],
                  ),

                  Container(
                    height: 30.h,
                    width: 230.w,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(30))),
                    child:   TextField(
                      decoration: InputDecoration(
                        hintText: '请输入纳税人识别号',
                        hintStyle:TextStyle(fontSize: 12.sp,color: MyColors.textColor),
                        filled: true,
                        fillColor: MyColors.backgreyColor,
                        border: InputBorder.none,
                        alignLabelWithHint: true,
                        contentPadding: EdgeInsets.symmetric(vertical: 10.0.h, horizontal: 10.0.w),
                      ),
                      textAlign: TextAlign.right,
                      style: TextStyle(color: Colors.black),
                      onChanged: (value) {
                        setState(() {
                          print(value);
                        });
                      },
                    ),
                  ),

                ],
              ),
              SizedBox(height: 8.h,),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text("地址",style: TextStyle(color: Colors.black),),
                  Container(
                    height: 30.h,
                    width: 230.w,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(30))),
                    child:   TextField(
                      decoration: InputDecoration(
                        hintText: '请输入企业地址',
                        hintStyle:TextStyle(fontSize: 12.sp,color: MyColors.textColor),
                        filled: true,
                        fillColor: MyColors.backgreyColor,
                        border: InputBorder.none,
                        alignLabelWithHint: true,
                        contentPadding: EdgeInsets.symmetric(vertical: 10.0.h, horizontal: 10.0.w),
                      ),
                      textAlign: TextAlign.right,
                      style: TextStyle(color: Colors.black),
                      onChanged: (value) {
                        setState(() {
                          print(value);
                        });
                      },
                    ),
                  ),

                ],
              ),
              SizedBox(height: 8.h,),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text("电话",style: TextStyle(color: Colors.black),),
                  Container(
                    height: 30.h,
                    width: 230.w,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(30))),
                    child:   TextField(
                      decoration: InputDecoration(
                        hintText: '请输入电话号码',
                        hintStyle:TextStyle(fontSize: 12.sp,color: MyColors.textColor),
                        filled: true,
                        fillColor: MyColors.backgreyColor,
                        border: InputBorder.none,
                        alignLabelWithHint: true,
                        contentPadding: EdgeInsets.symmetric(vertical: 10.0.h, horizontal: 10.0.w),
                      ),
                      textAlign: TextAlign.right,
                      style: TextStyle(color: Colors.black),
                      onChanged: (value) {
                        setState(() {
                          print(value);
                        });
                      },
                    ),
                  ),

                ],
              ),
              SizedBox(height: 8.h,),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [

                  Text("开户行",style: TextStyle(color: Colors.black),),

                  Container(
                    height: 30.h,
                    width: 230.w,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(30))),
                    child:   TextField(
                      decoration: InputDecoration(
                        hintText: '请输入开户行名称',
                        hintStyle:TextStyle(fontSize: 12.sp,color: MyColors.textColor),
                        filled: true,
                        fillColor: MyColors.backgreyColor,
                        border: InputBorder.none,
                        alignLabelWithHint: true,
                        contentPadding: EdgeInsets.symmetric(vertical: 10.0.h, horizontal: 10.0.w),
                      ),
                      textAlign: TextAlign.right,
                      style: TextStyle(color: Colors.black),
                      onChanged: (value) {
                        setState(() {
                          print(value);
                        });
                      },
                    ),
                  ),

                ],
              ),
              SizedBox(height: 8.h,),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text("账号",style: TextStyle(color: Colors.black),),

                  Container(
                    height: 30.h,
                    width: 230.w,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(30))),
                    child:   TextField(
                      decoration: InputDecoration(
                        hintText: '请输入开户行帐号',
                        hintStyle:TextStyle(fontSize: 12.sp,color: MyColors.textColor),
                        filled: true,
                        fillColor: MyColors.backgreyColor,
                        border: InputBorder.none,
                        alignLabelWithHint: true,
                        contentPadding: EdgeInsets.symmetric(vertical: 10.0.h, horizontal: 10.0.w),
                      ),
                      textAlign: TextAlign.right,
                      style: TextStyle(color: Colors.black),
                      onChanged: (value) {
                        setState(() {
                          print(value);
                        });
                      },
                    ),
                  ),

                ],
              ),
              SizedBox(height: 8.h,),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text("设为默认抬头",style: TextStyle(color: Colors.black),),
                  Switch(
                    value: isSwitched,
                    activeColor:Colors.white,
                    activeTrackColor:MyColors.themeColor,
                    inactiveThumbColor:MyColors.themeColor,
                    inactiveTrackColor:MyColors.backgreyColor,
                    onChanged: (value) {
                      setState(() {
                        isSwitched = value;
                      });
                    },
                  ),
                ],
              ),
            ],
          ),
        )
      ],
    ),
    ),
      Container(
        height: 80.h,
        color: Colors.white,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
                height: 40.h ,
                margin: EdgeInsets.only(left: 30.w,right: 30.w),
                decoration: BoxDecoration(
                    color:MyColors.themeColor,
                    borderRadius: BorderRadius.all(Radius.circular(30))),

                width: double.infinity,


                child: TextButton(
                  child: Text(messages["提交"],style: TextStyle(color: Colors.white,fontSize: 14.sp),),

                  onPressed: (){

                  },
                )
            ),
          ],
        ),
      ),
    ],
    ),


    );
  }
}
